//
//  HomeWorkTableViewCell.swift
//  BellManage
//
//  Created by Bestsch on 16/4/15.
//  Copyright © 2016年 wsl. All rights reserved.
//

import UIKit

class HomeWorkTableViewCell: UITableViewCell {

    
    var icon, senderLabel,titlelabel, timeLabel, contentLabel, fujian: UILabel!
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setUp()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUp() {
        
        icon = UILabel.init(frame: CGRect(x: 10, y: 10, width: 40, height: 40))
        icon.layer.masksToBounds = true
        icon.layer.cornerRadius = 20
        icon.numberOfLines = 0
        icon.font = UIFont.systemFont(ofSize: 18)
        icon.textAlignment = NSTextAlignment.center
        icon.textColor = UIColor.white
        icon.backgroundColor = UIColor.init(hexString: "949595", alpha: 1)
        
        titlelabel = UILabel.init(frame: CGRect(x: icon.frame.maxX + 10, y: 10, width: screenW - 70, height: 30))
        titlelabel.font = UIFont.systemFont(ofSize: 16)
        titlelabel.textColor = UIColor.darkGray
        
        senderLabel = UILabel.init(frame: CGRect(x: icon.frame.maxX + 10, y: titlelabel.frame.maxY, width: screenW - 70, height: 20))
//        senderLabel.font = UIFont.systemFontOfSize(14)
        
        timeLabel = UILabel.init(frame: CGRect(x: icon.frame.maxX + 10, y: senderLabel.frame.maxY, width: screenW - 70, height: 30))
        timeLabel.font = UIFont.systemFont(ofSize: 14)
        timeLabel.textColor = textlight
        
        
        contentLabel = UILabel.init(frame: CGRect(x: icon.frame.maxY + 10, y: timeLabel.frame.maxY , width: screenW - 70, height: 30))
        contentLabel.font = UIFont.systemFont(ofSize: 14)
        contentLabel.textColor = textlight
        
        fujian = UILabel.init(frame: CGRect(x: contentLabel.frame.minX, y: contentLabel.frame.maxY, width: screenW - 70, height: 30))
        fujian.font = UIFont.systemFont(ofSize: 14)
        fujian.textColor = textlight
        
        self.contentView.addSubview(icon)
        self.contentView.addSubview(senderLabel)
        self.contentView.addSubview(titlelabel)
        self.contentView.addSubview(timeLabel)
        self.contentView.addSubview(contentLabel)
        self.contentView.addSubview(fujian)
        
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
